<template>
  <div>
    <button
      :method="method"
      :class="{ current: method === curMethod }"
      @click="changeMethod"
    >
      {{ innerText }}
    </button>
  </div>
</template>

<script>
export default {
  name: 'CalButton',
  props: {
    innerText: String,
    method: String,
    curMethod: String
  },
  methods: {
    changeMethod() {
      this.$emit('dispatch','CHANGE_METHOD', this.method)
    }
  }
}
</script>

<style>
  .current{
    background-color: orange;
    color: #fff;
  }
</style>
